package com.sky.controller.user;

/**
 * @PROJECT_NAME:sky-take-out
 * @NAME: ShopController
 * @AUTHOR:$$
 * @Date:2023-08-17
 * @DESCRIPTION:
 **/

import com.sky.constant.RedisKeyConstant;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 店铺控制器
 *
 * @author t3rik
 */
@Api(tags ="店铺相关接口")
@RestController("userShopController")
@RequestMapping("/user/shop")
public class ShopController {
    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 查看营业厅
     */
    @GetMapping("/status")
    public Result<Integer> getStatus(){
        //直接从redis中取状态
        Integer status = (Integer) this.redisTemplate.opsForValue().get(RedisKeyConstant.SHOP_STATUS_KEY);
        return Result.success(status);
    }
}
